﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SuiYuan.UI.Controls.Notify
{
    public partial class LayUIConfirmMessageBox : Window
    {
        public LayUIConfirmMessageBox()
        {
            InitializeComponent();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }
        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void main_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }

        private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        public static bool Show(string title, string content, string okText = "确定", string cancelText = "取消")
        {
            LayUIConfirmMessageBox messageBox = new LayUIConfirmMessageBox();
            messageBox.Title.Text = title;
            messageBox.Text1.Text = content;
            messageBox.OKButton.Content = okText;
            messageBox.CancelButton.Content = cancelText;
            return messageBox.ShowDialog().Value;
        }
    }
}
